import { Column, Entity, PrimaryGeneratedColumn, CreateDateColumn } from 'typeorm';

@Entity('comment')
export class CommentData {
  @PrimaryGeneratedColumn({
    type: 'bigint',
    name: 'id',
    comment: '主键id',
  })
  id: string;

  @Column({
    type: 'varchar',
    default: '',
    length: 50,
    name: 'comment_username',
    comment: '评论者用户名',
  })
  commentUserName: string;
  @Column({
    type: 'varchar',
    default: '',
    length: 50,
    name: 'comment_alias',
    comment: '别名',
  })
  alias: string;
  @Column({
    type: 'bigint',
    name: 'comment_user_id',
    comment: '评论者ID',
  })
  commentUserId: bigint;

  @Column({
    type: 'bigint',
    name: 'comment_note_id',
    comment: '文章ID',
  })
  commentNoteId: string;

  @Column({
    type: 'varchar',
    length: 1500,
    name: 'content',
    select: false,
    comment: '评论内容',
  })
  content: string;

  @Column({
    type: 'varchar',
    default: '',
    name: 'avatar',
    comment: '头像',
  })
  avatar: string;

  @CreateDateColumn({
    type: 'timestamp',
    nullable: false,
    name: 'create_time',
    comment: '创建时间',
  })
  createTime: Date;
}

export default CommentData;
